<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>js模板引擎art-template的使用</title>
<script src="template-web.js"></script>
</head>
<body>
<div id="content"></div>
<script id="test" type="text/html">
<h1><%=title%></h1>
<ul>
<% for(var i = 0;i < list.length; i++){ %>
<li><%=i+1%>:{{ list[i] }}</li>
<% } %>
</ul>
</script>
<script>
var data = {
    title: "爱好",
    list: ["读书", "听歌", "摄影", "旅行", "跑步", "爬山", "骑行"]
};
var html = template("test", data);
document.getElementById("content").innerHTML = html;
</script>
<!--
文档地址
http://aui.github.io/art-template/zh-cn/docs/
-->
</body>
</html>
